<template>
  <div class="main-content" style="width: 60%">
    <div class="card">

      <div style="margin: 50px 0">
        <div style="margin-bottom: 30px; font-size: 22px; font-weight: bold; text-align: center">{{ info.infoTitle }}</div>
        <div style="margin-bottom: 30px; font-size: 15px; font-weight: bold; text-align: center">{{ info.info }}</div>

        <div class="w-e-text" style="line-height: 26px">
          <div v-html="info.infoContent"></div>
        </div>
      </div>

    </div>

    <el-dialog userName="报名信息" :visible.sync="fromVisible" width="40%" :close-on-click-modal="false" destroy-on-close>
      <el-form label-width="100px" style="padding-right: 50px" :model="form" :rules="rules" ref="formRef">
        <el-form-item prop="phone" label="手机号">
          <el-input v-model="form.phone" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="fromVisible = false">取 消</el-button>
        <el-button type="primary" @click="sign">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { mapState, mapActions } from 'vuex'
import { customFormatterData } from '@/utils/dateTimeFormatter'
export default {
  name: "ActivityDetail",
  data() {
    return {
      id: this.$route.query.id,
      activity: {},
      fromVisible: false,
      form: {},
      user: JSON.parse(localStorage.getItem('xm-user') || '{}'),
      rules: {
        phone: [
          { required: true, message: '手机号必填', trigger: 'blur' }
        ]
      }
    }
  },
  created() {
    this.getInfoByIdActions(this.id)
  },
  computed: {
    ...mapState('userInfo', ['info'])
  },
  methods: {
    customFormatterData,
    ...mapActions('userInfo', ['getInfoByIdActions']),
    sign() {
    },
    handleSign() {
      this.form = {}
      this.form.userId = this.user.id
      this.form.activityId = this.id
      this.fromVisible = true
    },
  }
}
</script>

<style scoped>
.item {
  color: #666; margin-bottom: 40px
}
</style>